// login
let [login, user_phone, user_psw] = [
    $("#btn_login"), $("#user_phone"), $("#user_psw")
];
class Login{
    constructor(){}
    init(login, user_phone, user_psw){
        this.login = login;
        this.user_phone = user_phone;
        this.user_psw = user_psw;
        this.bindEvent();
    }
    bindEvent(){
        this.login.click(this.get.bind(this));
    }
    get(){
        var user_name = this.user_phone.val();
        var user_password = this.user_psw.val();
        xhrPost("http://10.9.65.230/interface/login.php",{
            user_name,
            user_password
        })
        .then((res)=>{
            console.log(res);
            window.location.href = 'http://localhost:8080/index.html';
        })
    }
}
var l = new Login();
l.init(login, user_phone, user_psw);